package com.bss.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.andy.basics.AbstractEntity;

@Entity
@Table(name = "Activity")
public class Activity extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3175580171322938096L;
	private int id;
	private ActivityType activityType = new ActivityType();
	private String description;
	private Date activityDate = new Date();

	public Activity() {
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(final int id) {
		this.id = id;
	}

	public void setDescription(final String description) {
		this.description = description;
	}

	@Column(name = "description", length = 100)
	public String getDescription() {
		return this.description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "activityDate", length = 19)
	public Date getActivityDate() {
		return this.activityDate;
	}

	public void setActivityDate(final Date activityDate) {
		this.activityDate = activityDate;
	}

	public void setActivityType(final ActivityType activityType) {
		this.activityType = activityType;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "idActivityType")
	public ActivityType getActivityType() {
		return this.activityType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 19)
	public Date getDate() {
		return this.date;
	}

}
